      SUBROUTINE SETUP
      RETURN
      END
C   HS59 AS PRINTED IN HOCK&SCHITTKOWSKI BOOK (PRINTING ERROR)
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),XK(19),FX,X1,X2
      SAVE XK
      DATA XK/75.196D0,3.8112D0,.0020567D0,1.0345D-5,6.8306D0,
     1         0.030234D0,1.28134D-3,2.266D-7,.25645D0,0.0034604D0,
     2       1.3514D-5,28.106D0,5.2375D-6,6.3D-8,7.D-10,3.405D-4,
     3       1.6638D-6,2.8673D0,3.5256D-5/
      ICF=ICF+1
      X1=X(1)
      X2=X(2)
      FX=-XK(1)+XK(2)*X1+XK(3)*X1**3-XK(4)*X1**4+XK(5)*X2-XK(6)*X1*X2
     1   +XK(7)*X2*X1**2+XK(8)*X1**4*X2-XK(9)*X2**2+XK(10)*X2**3
     2   -XK(11)*X2**4+XK(12)/(X2+1.D0)+XK(13)*X1**2*X2**2
     3   +XK(14)*X1**3*X2**2-XK(15)*X1**3*X2**3+XK(18)*DEXP(
     4  .0005D0*X1*X2)-XK(19)*X1**3*X2-XK(16)*X1*X2**2+XK(17)*X1*X2**3
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),GRADF(NX),XK(19),X1,X2
      SAVE XK
      DATA XK/75.196D0,3.8112D0,.0020567D0,1.0345D-5,6.8306D0,
     1         0.030234D0,1.28134D-3,2.266D-7,.25645D0,0.0034604D0,
     2       1.3514D-5,28.106D0,5.2375D-6,6.3D-8,7.D-10,3.405D-4,
     3       1.6638D-6,2.8673D0,3.5256D-5/
      ICGF=ICGF+1
      X1=X(1)
      X2=X(2)
      GRADF(1)=XK(2)+3.D0*XK(3)*X1**2-4.D0*XK(4)*X1**3-XK(6)*X2
     1         +2.D0*XK(7)*X2*X1+4.D0*XK(8)*X1**3*X2+2.D0*XK(13)*X1*
     2         X2**2+3.D0*XK(14)*X1**2*X2**2-3.D0*XK(15)*X1**2*X2**3
     3        -XK(16)*X2**2+XK(17)*X2**3+.0005D0*XK(18)*X2*DEXP(
     4        .0005D0*X1*X2)-3.D0*XK(19)*X1**2*X2
      GRADF(2)=XK(5)-XK(6)*X1+XK(7)*X1**2+XK(8)*X1**4-2.D0*XK(9)*X2
     1         +3.D0*XK(10)*X2**2-4.D0*XK(11)*X2**3-XK(12)/(X2+1.D0)**2
     2         +XK(13)*X1**2*2.D0*X2+2.D0*XK(14)*X1**3*X2-3.D0*
     3        XK(15)*X1**3*X2**2-2.D0*XK(16)*X1*X2+3.D0*XK(17)*X1*X2
     4         **2+.0005D0*XK(18)*X1*DEXP(.0005D0*X1*X2)-XK(19)*X1**3
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GRADHI(NX)
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I,K
      DOUBLE PRECISION X(NX),GXI
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      IF(I .GT. 2)      GOTO 100
      GXI=X(I)
      RETURN
  100 CONTINUE
      K=I-2
      GOTO(200,300,400,500,600),K
  500 CONTINUE
      GXI=X(2)-X(1)**2/125.D0
      RETURN
  200 CONTINUE
      GXI=75.D0- X(1)
      RETURN
  300 CONTINUE
      GXI=65.D0-X(2)
      RETURN
  400 CONTINUE
      GXI=X(1)*X(2)-700.D0
      RETURN
  600 CONTINUE
      GXI=(X(2)-50.D0)**2-5.D0*(X(1)-55.D0)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX) ,GRADGI(NX)
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
      DO      50      J=1,2
      GRADGI(J)=0.D0
   50 CONTINUE
      GOTO(100,100,200,200,300,400,500),I
  100 CONTINUE
      GRADGI(I)=1.D0
      RETURN
  200 CONTINUE
      GRADGI(I-2)=-1.D0
      RETURN
  300 CONTINUE
      GRADGI(1)=X(2)
      GRADGI(2)=X(1)
      RETURN
  400 CONTINUE
      GRADGI(1)=-2.D0*X(1)/125.D0
      GRADGI(2)= 1.D0
      RETURN
  500 CONTINUE
      GRADGI(1)=-5.D0
      GRADGI(2)= 2.D0*(X(2)-50.D0)
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS59PERR'/
      DATA X(1),X(2)/90.0D0,10.D0/
      DATA N/2/ , NH/0/ , NG/7/
      DATA DEL0/1.00D0/ ,TAU0/1.D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,7)/-1,0,0,1,1,1,1,2,1,1,1,-1,1,2,-1,
     F           -1,0,0,-1,0,0,-1,0,0/
      END
